package com.scrcu.cloud.wechat.home.endpoint.staff.controller;


import com.scrcu.cloud.wechat.home.endpoint.common.model.RestResponse;
import com.scrcu.cloud.wechat.home.endpoint.staff.service.IStaffService;
import com.scrcu.cloud.wechat.home.endpoint.staff.service.IStaffUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/staffUsr")
public class StaffUserController {
    @Resource
    private IStaffUserService iStaffUserService;

    @PostMapping("/getUserList")
    public RestResponse getUserList(@RequestParam("staffid") String staffid){
        return iStaffUserService.getUserList(staffid);
    }

    @PostMapping("/getBooksByStaff")
    public RestResponse getBooksByStaff(@RequestParam("staffid") String staffid,
                                        @RequestParam("status") String status){
        return iStaffUserService.getBooksByStaff(staffid,status);
    }

    @PostMapping("/dealbook")
    public RestResponse dealbook(@RequestParam("staffid") String staffid,
                                        @RequestParam("bookid") String bookid){
        return iStaffUserService.dealbook(staffid,bookid);
    }

}
